package dbModel

import "fmt"

const (
	TypeMember = iota
	TypeMemberCard
	TypeMemberCardLog
	TypeProject
	TypeStorage
	TypeStorageMaster
	TypeCheckout
	TypeProduct
)

func RedisKey(ty int32, query ...any) string {
	temp := ""
	extraKey := ""
	if query != nil {
		extraKey = fmt.Sprintf("/%v", query)
	}
	switch ty {
	case TypeMember:
		temp = TableMember
	case TypeMemberCard:
		temp = TableMemberCard
	case TypeMemberCardLog:
		temp = TableMemberCardLog
	case TypeProject:
		temp = TableProject
	case TypeStorage:
		temp = TableStorage
	case TypeStorageMaster:
		temp = TableStorageRecord
	case TypeCheckout:
		temp = TableService
	case TypeProduct:
		temp = TableProduct
	default:
		temp = "None/"
	}
	return temp + extraKey
}
